import request from '@/utils/request'
//获取用户列表
export function user_list(page,limit,keyword) {
  return request({
    url: '/market/system/user_list',
    method: 'post',
    data:{
      page,
      limit,
      keyword
    }
  })
}
//删除用户
export function user_del(uid) {
  return request({
    url: '/market/system/user_del',
    method: 'post',
    data:{
     uid
    }
  })
}
//添加用户
export function user_add(account,real_name,pwd,pwd2,market_role) {
  return request({
    url: '/market/system/user_add',
    method: 'post',
    data:{
     account,
     real_name,
     pwd,
     pwd2,
     market_role
    }
  })
}
//编辑用户
export function user_edit(dat) {
  return request({
    url: '/market/system/user_edit',
    method: 'post',
    data:{
     uid:dat.uid,
     pwd:dat.pwd,
     pwd2:dat.pwd2,
     real_name:dat.real_name,
     market_role:dat.market_role
    }
  })
}
//获得角色
export function role_list(data) {
  return request({
    url: '/market/system/role_list',
    method: 'post',
    data
  })
}
//编辑用户
export function user_change_self(dat) {
  return request({
    url: '/market/system/user_change_self',
    method: 'post',
    data:{
     real_name:dat.real_name,
     pwd:dat.pwd,
     pwd2:dat.pwd2,
    }
  })
}
//生产平台用户下拉搜索
export function user_select_list_product(keyword) {
  return request({
    url: '/market/system/user_select_list_product',
    method: 'post',
    data:{
     keyword
    }
  })
}
//生产平台用户下拉搜索
export function change_product_to_market(uid) {
  return request({
    url: '/market/system/change_product_to_market',
    method: 'post',
    data:{
     uid
    }
  })
}
